<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">

	<title>config</title>

	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

	<link rel="stylesheet" href="/layui/css/layui.css" media="all">
	<script src="/layui/layui.js" charset="utf-8"></script>
	<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
	<style>
		.box {
			width: 1400px;
			margin: 0 auto;
		}

		.layui-row {
			margin-bottom: 30px;
		}
	</style>
</head>

<body>
	<br><br>

	<div class="box">

		<form class="layui-form" action="/saveConfig.html" onsubmit="return false" method="POST">
			<table class="layui-table">
				<colgroup>
					<col width="150">
					<col width="200">
					<col>
				</colgroup>
				<thead>
					<tr>
						<th>表字段</th>
						<th>JavaBean属性</th>
						<th>表字段类型</th>
						<th>JavaBean类型</th>
						<th>作用类型</th>
						<th>字段描述</th>
						<th>列显示</th>
						<th>增改</th>
						<th>查询</th>
						<th>查询方式</th>
					</tr>
				</thead>
				<tbody>
					<#list config as cfg>
						<tr>
							<input type="hidden" value="${cfg.codeGenId}" name="codeGenId" />
							<td><input type="text" value="${cfg.columnName}" name="columnName" class="layui-input"
									disabled /> </td>
							<td><input type="text" value="${cfg.propertyName?uncap_first}" name="propertyName"
									class="layui-input" /> </td>
							<td><input type="text" value="${cfg.columnType}" name="columnType" class="layui-input" />
							</td>
							<td><input type="text" value="${cfg.type}" name="type" class="layui-input" /> </td>
							<td>
								<select name="formType">
									<option value="1">input</option>
									<option value="0">password</option>
									<option value="2">select</option>
									<option value="3">checkbox</option>
									<option value="4">radio</option>
									<option value="5">textarea</option>
									<option value="6">date</option>
								</select>
							</td>
							<td><input type="text" value="${cfg.remark}" name="remark" class="layui-input" /> </td>
							<td><input type="checkbox" name="isShow" value="1" lay-skin="primary" checked /> </td>
							<td><input type="checkbox" name="isForm" value="1" lay-skin="primary" checked /> </td>
							<td><input type="checkbox" name="isSelect" value="1" lay-skin="primary" checked /> </td>
							<td>
								<select name="selectType">
									<option value="1">等于</option>
									<option value="2" selected>模糊</option>
									<option value="3">大于</option>
									<option value="4">小于</option>
									<option value="5">不等于</option>
									<option value="6">大于等于</option>
									<option value="7">小于等于</option>
								</select>
							</td>
						</tr>
					</#list>
				</tbody>
			</table>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>
	</div>
	<script>
		layui.use('form', function () {
			var $ = layui.jquery, form = layui.form;

			//监听提交
			form.on('submit(formDemo)', function (data) {
				console.log(JSON.stringify(data.field));
				console.log(JSON.stringify($(".layui-form").serialize()));


				return false;
			});
		});
	</script>
</body>

</html>